/**
 * @author tianchao
 */
import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}
/**
 * 获取企业用户列表
 * @param {*} query
 */
export function getUserList(query) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysUserLogin/adminQueryPage',
    method: 'post',
    data: query
  })
}
/**
 * 创建企业用户
 * @param {*} data
 */
export function create(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysUserLogin/adminInsert',
    method: 'post',
    data
  })
}
/**
 * 获取企业用户信息 -用户编辑回显
 * @param {*} id
 */
export function getDetail(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysUserLogin/get',
    method: 'post',
    data: { id }
  })
}
/**
 * 更新企业用户
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysUserLogin/update',
    method: 'post',
    data
  })
}
/**
 * 更新企业用户手机号
 * @param {*} data
 */
export function updatePhone(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysUserLogin/updatePhoneNumber',
    method: 'post',
    data
  })
}
/**
 * 更新企业用户证件号码
 * @param {*} data
 */
export function updateIdnumber(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysUserLogin/updateIdNumber',
    method: 'post',
    data
  })
}
/**
 * 删除企业用户
 * @param {*} ids
 */
export function del(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysUserLogin/delete',
    method: 'post',
    data: { ids }
  })
}
/**
 * 修改企业人员密码
 */
export function updatePassword(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysUserLogin/updatePassword',
    method: 'post',
    data
  })
}
/**
 * 异步企业部门树
 */
export function getComAndOrgTree(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/orgInfo/queryAdminOrgAndDep',
    method: 'post',
    data
  })
}
/**
 * 根据搜索条件查询组织树
 * @param {*} query
 */
export function roleListByName(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/orgInfo/getAdminOrgAndDepTreeByName',
    method: 'post',
    data
  })
}

